/*
Class: User
Author: Kyle Hawkins
Last Modified: 02/27/2011

*/
package norm.reference

class User {

	long id
	String username
	String password
	String email
	int active
	String userLevel
	
	String toString()
	{ "Username: $username Email: $email Active: $active Userlevel: $userLevel"}
		
    static constraints = {
	//Establish some validation for various attributes. 
		userLevel(inList:["admin","user","faculty","research"])
		email(blank:false) 
		username(blank:false)
		password(blank:false)
		active(blank:false)
	}
	
	static mapping = {
		table "NORM_User"
	}
	
	boolean verifyPassword(String login)
	{
		//Method used to compare passwords for login and authentication purposes. 
		if(password.compareTo(login) == 0)
		{
			return true
		}
		else
		{
			return false
		}
	}
}
